<template>
  <div id="app">
      <div ></div>
      <!-- 在父组件里自定义一个事件名称，让他等于一个函数，然后methods里去写这个函数 -->
      <Son :aaa="aaa" v-on:zichuanfu="zcf"></Son>
      <Dau></Dau>
  </div>
</template>

<style lang="scss">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

#nav {
  padding: 30px;

  a {
    font-weight: bold;
    color: #2c3e50;

    &.router-link-exact-active {
      color: #42b983;
    }
  }
}
</style>
<script>
import Son from "./views/son.vue"
import Dau from "./views/daughter.vue"
 export default {
     components:{
         Son,
         Dau
     },
     data() {
         return {
             aaa:1111
         }
     },
     methods:{
        // 该函数的参数就是子组件传递过来的数据
        zcf(data) {
            console.log(data)
        }
     }
 }
</script>
